package com.xyzq.cgate.core.handler.mapping;

import com.xyzq.cgate.core.handler.CgateWebHandler;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.reactive.handler.AbstractHandlerMapping;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

/**
 * @Description:
 * @author chenchen
 * @date 2019/6/20 12:14
 */
public class CgateWebHandlerMapping extends AbstractHandlerMapping {

    private final CgateWebHandler cgateWebHandler;

    public CgateWebHandlerMapping(CgateWebHandler cgateWebHandler) {
        this.cgateWebHandler = cgateWebHandler;
        setOrder(1);
    }

    @Override
    protected Mono<?> getHandlerInternal(ServerWebExchange serverWebExchange) {
        return Mono.just(cgateWebHandler);
    }

}
